# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        博智科技  
# Name:         demo1242
# Description:
# Author:       yzl
# Date:         2019-02-09
#-------------------------------------------------------------------------------

import time
import locale

# 设置日期和时间为中文utf-8
locale.setlocale(locale.LC_ALL,'zh_CN.UTF-8')
print(time.localtime())
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime()))

# 格式化成中文格式
print(time.strftime('%Y年 %m月%日 %H时%M分%S秒',time.localtime()))
#
print(time.strftime('%Y{y}%m{m}%{d} %H{h}%M{M}%S{s}').format(y='年',m='月',d='日',h='时',M='分',s='秒'))
#
print(time.strftime('今天是%A'),time.localtime())

